package edu.zut.cs.software.estateagent.property.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import edu.zut.cs.software.base.service.impl.GenericTreeManagerImpl;
import edu.zut.cs.software.estateagent.property.dao.HolderDao;
import edu.zut.cs.software.estateagent.property.domain.Holder;
import edu.zut.cs.software.estateagent.property.service.HolderManager;

@Service("holderManager")
@Transactional
public class HolderManagerImpl extends GenericTreeManagerImpl<Holder, Long> implements HolderManager {
	HolderDao holderDao;

	@Autowired
	public void setHolderDao(HolderDao holderDao) {
		this.holderDao = holderDao;
		this.treeDao = this.holderDao;
		this.dao = this.treeDao;
	}

	@Override
	public boolean show() {
		// TODO Auto-generated method stub
		return false;
	}
	/*
	 * @Autowired public List findall(){ List<Holder> hostlist=new
	 * ArrayList<>(); hostlist=holderDao.findAll(); return hostlist; }
	 * 
	 * @Autowired //根据id查找信息 public List<Holder>findbyid(Iterable<Long> ids) {
	 * 
	 * List<Holder> hostlist=holderDao.findAllById(ids); return hostlist; }
	 */
	//查找全部信息 
	@Override
	public List findall() {
		List<Holder> hostlist=new ArrayList<>();
		hostlist=holderDao.findAll();
		return hostlist;
	}
	//根据id查找信息
	@Override
	public List<Holder>findbyid(Iterable<Long> ids) {
		 
		 List<Holder> hostlist=holderDao.findAllById(ids); 
		 return hostlist; 
		 }


}
